package com.bdqn.vueboot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.bdqn.vueboot.config.BascText;
import com.bdqn.vueboot.entity.ExamineApprove;
import com.bdqn.vueboot.mapper.ExamineApproveMapper;
import com.bdqn.vueboot.service.ExamineApproveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 审批表(ExamineApprove)表服务实现类
 *
 * @author makejava
 * @since 2022-12-03 09:09:35
 */
@Service("examineApproveService")
public class ExamineApproveServiceImpl extends ServiceImpl<ExamineApproveMapper, ExamineApprove> implements ExamineApproveService {
    @Autowired
    ExamineApproveMapper examineApproveMapper;

    @Override
    public List<ExamineApprove> listEXamineAppro() {
        Long carId = BascText.getCarId();
        LambdaQueryWrapper<ExamineApprove> page = new LambdaQueryWrapper<>();
        page.eq(carId!=null,ExamineApprove::getExamineDepartmentName,carId);
        List<ExamineApprove> examineApproves = examineApproveMapper.selectList(page);
        return examineApproves;
    }

    @Override
    public int listEXamineApproCount() {Long carId = BascText.getCarId();
        LambdaQueryWrapper<ExamineApprove> page = new LambdaQueryWrapper<>();
        page.eq(carId!=null,ExamineApprove::getExamineDepartmentName,carId);
        Integer integer = examineApproveMapper.selectCount(page);
        return integer;
    }
}

